package org.egov.dbHandler;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ResourceBundle;

public class DatabaseConn {
	private Connection conn=null;
	
	
	public Connection getConnection(){	
	  ResourceBundle bundle = ResourceBundle.getBundle("DBConfig");
	  String driver = bundle.getString("driver");
	  String url = bundle.getString("url");
	  String user = bundle.getString("user");
	  String password = bundle.getString("password");
	 //System.out.println(url+"\t"+user+"\t"+password);
	  
	  try {		
			//Class.forName("oracle.jdbc.driver.OracleDriver");	
			//String url="jdbc:oracle:thin:@localhost:1521:BSIEGOV";
			Class.forName(driver); 		
			try {
				conn = DriverManager.getConnection(url, user, password);
				//conn=DriverManager.getConnection(url,"GUCHENG","ADMIN");
			} catch (SQLException e) {
				e.printStackTrace();
			}		
			
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	return conn;
	}
	

}
